<!--
 * @Author: xuhy 1727317079@qq.com
 * @Date: 2022-09-15 20:12:24
 * @LastEditors: xuhy 1727317079@qq.com
 * @LastEditTime: 2022-09-15 20:36:24
 * @FilePath: \vue3_test\src\components\SonOne.vue
 * @Description: 子组件
-->
<template>
  <div class="child">
    <h3>我是Child组件(子)</h3>
    <SonOne></SonOne>
  </div>
</template>

<script>
import { inject } from "vue";
import SonOne from "./SonOne";
export default {
  name: "ChildOne",
  components: { SonOne },
  setup() {
    let x = inject("car");
    console.log(x, "---Child---");
  },
};
</script>

<style>
.child {
  background-color: skyblue;
  padding: 10px;
}
</style>
